import { JSX } from 'react'
import { MyFile } from '../../type'
import { FileItem } from './file-item'

interface Props {
  files: MyFile[]
  onlyShowDir?: boolean
  deep: number
}

export function FileTree(props: Props): JSX.Element {
  return (
    <div>
      {props.files.map((file) => {
        return <FileItem deep={props.deep} key={file.path} file={file} />
      })}
    </div>
  )
}
